<html>
<head>
    <#include "../common/header.ftl">
    <script type="text/javascript" src="/sell/static/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="/sell/static/js/bootstrap-datetimepicker.zh-CN.js"></script>
</head>
<body>
<div class="content-wrapper" style="display: flex">
    <div class="nav-wrapper" style="flex: 0 0 200px;width: 200px">
            <#include "../common/nav.ftl">
    </div>
    <div id="page-content-wrapper" style="flex: 1;text-align: center !important;  margin-left: 20px">
        <div id="contain" style="margin: 0 auto">
            <div id="tbar">
            </div>
            <table id="connent">
                <tr>
                    <td class="col-sm-3">
                        <dl>
                            <dt><b>交易成功单数</b></dt>
                            <dd><em><strong>&nbsp;</strong></em></dd>
                            <dd style="float: left;margin-left:60px">日&nbsp;
                                <#if 0 lte statData.sellSuccessYesRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellSuccessYesRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">月&nbsp;
                                <#if 0 lte statData.sellSuccessMonthRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellSuccessMonthRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">季&nbsp;
                                <#if 0 lte statData.sellSuccessSeasonRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellSuccessSeasonRate}%
                            </dd>
                        </dl>
                    </td>


                    <td class="col-sm-3">
                        <dl>
                            <dt><b>交易成功额度</b></dt>
                            <dd><em><strong>&nbsp;</strong></em></dd>
                            <dd style="float: left;margin-left:60px">日&nbsp;
                                <#if 0 lte statData.successYesSaleRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.successYesSaleRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">月&nbsp;
                                <#if 0 lte statData.successMonthSaleRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.successMonthSaleRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">季&nbsp;
                                <#if 0 lte statData.successSeasonSaleRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.successSeasonSaleRate}%
                            </dd>
                        </dl>
                    </td>

                <#--  -->

                    <td class="col-sm-3">
                        <dl>
                            <dt><b>订单取消单数</b></dt>
                            <dd><em><strong>&nbsp;</strong></em></dd>
                            <dd style="float: left;margin-left:60px">日&nbsp;
                                <#if 0 lte statData.sellCancelYesRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellCancelYesRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">月&nbsp;
                                <#if 0 lte statData.sellCancelMonthRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellCancelMonthRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">季&nbsp;
                                <#if 0 lte statData.sellCancelSeasonRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellCancelSeasonRate}%
                            </dd>
                        </dl>
                    </td>

                    <td class="col-sm-3">
                        <dl>
                            <dt><b>退款单数</b></dt>
                            <dd><em><strong>&nbsp;</strong></em></dd>
                            <dd style="float: left;margin-left:60px">日&nbsp;
                                <#if 0 lte statData.sellPaybackYesRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellPaybackYesRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">月&nbsp;
                                <#if 0 lte statData.sellPaybackMonthRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellPaybackMonthRate}%
                            </dd>
                            <dd style="float: left;margin-left:60px">季&nbsp;
                                <#if 0 lte statData.sellPaybackSeasonRate>
                                <span class="glyphicon glyphicon-arrow-up" style="color: red">
                                <#else>
                                <span class="glyphicon glyphicon-arrow-down">
                                </#if>${statData.sellPaybackSeasonRate}%
                            </dd>
                        </dl>
                    </td>
                </tr>
            </table>
        </div>
        <div class="container-fluid">

            <div class="row-fluid">
                <div id="con6">
                    <table id='oldday'>
                        <caption>10天数据统计 2016-05-15 至 2016-05-24</caption>
                        <thead>
                        <tr>
                            <th>统计日期</th>
                             <#list dateList as date>
                                  <th>${date}</th>
                             </#list>

                        </tr>
                        </thead>

                        <tbody>
                        <!-----------第一条折线------------>
                        <tr>
                            <th>交易成功单数</th>
                             <#list sellSuccessList as c1>
                                   <td>${c1}</td>
                             </#list>
                        </tr>
                        <!-----------第二条折线------------>
                        <tr>
                            <th>交易成功额度</th>
                            <#list successSaleList as c2>
                                 <td>${c2}</td>
                            </#list>
                        </tr>
                        <!-----------第三条折线------------>
                        <tr>
                            <th>订单取消单数</th>
                            <#list sellCancelList as c3>
                                 <td>${c3}</td>
                            </#list>
                        </tr>
                        <!-----------第四条折线------------>
                        <tr>
                            <th>退款单数</th>
                            <#list sellPaybackList as c4>
                                 <td>${c4}</td>
                            </#list>
                        </tr>

                        </tbody>
                    </table>
                </div>

                <div class="span9 col-lg-12" style="margin-top: 20px">
                    <form action="/sell/stat/admin/list" class="bs-example bs-example-form" role="form">
                        <div class="input-group col-md-2 col-sm-2 input-append date form_datetime" style="float: left;"
                             data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1">
                            <input size="16" class="form-control" name="dateStart" type="text" placeholder="起始时间"
                                   value="2010-01-01" readonly>
                            <div class="input-group-addon">
                                <span class="add-on"><i class="glyphicon glyphicon-calendar"></i></span>
                            </div>
                        </div>
                        <div class="input-group col-md-2 col-sm-2 input-append date form_datetime"
                             style="float: left;margin-left: 20px;" data-date-format="dd MM yyyy - HH:ii p"
                             data-link-field="dtp_input1">
                            <input id="mdate" size="16" class="form-control" name="dateEnd" type="text"
                                   placeholder="结束时间" value="2018-08-24" readonly>
                            <div class="input-group-addon">
                                <span class="add-on"><i class="glyphicon glyphicon-calendar"></i></span>
                            </div>
                        </div>
                        <div class="input-group col-md-2 col-sm-2 input-append" style="float: left;margin-left: 20px;">
                            <div class="dropdown">
                                <label>按分类查询：</label>
                                <select name="type" class="btn btn-default">
                        <#if type == 0 >
                            <option value="0" selected="selected">日</option>
                            <option value="1">月</option>
                            <option value="2">季度</option>
                        <#elseif type == 1>
                           <option value="0">日</option>
                            <option value="1" selected="selected">月</option>
                            <option value="2">季度</option>
                        <#else >
                           <option value="0" selected="selected">日</option>
                            <option value="1">月</option>
                            <option value="2" selected="selected">季度</option>
                        </#if>
                                </select>
                            </div>
                        </div>
                        <div class="input-group col-md-2 col-sm-2 input-append" style="float: left;">
                            <button type="submit" class="btn btn-default">查找</button>
                        </div>
                        <div style="clear: both"></div>
                        <input type="text" name="openid" value="${openid}" style="display: none"/>
                    </form>
                </div>


                <div class="span9 col-lg-12" style="margin-top: 20px">
                    <table class="table table-bordered table-hover col-md-8">
                        <thead>
                        <tr>
                            <th>
                                日期
                            </th>
                            <th>
                                交易成功单数
                            </th>
                            <th>
                                交易成功额度
                            </th>
                            <th>
                                订单取消单数
                            </th>
                            <th>
                                退款单数
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                         <#list pageList.content as sellByDay>
                         <tr>
                             <td>
                                 ${sellByDay.updateTime}
                             </td>
                             <td>
                                 ${sellByDay.sellSuccess}
                             </td>
                             <td>
                                 ${sellByDay.successSale}
                             </td>
                             <td>
                                 ${sellByDay.sellCancel}
                             </td>
                             <td>
                                 ${sellByDay.sellPayback}
                             </td>
                         </tr>
                         </#list>
                        </tbody>
                    </table>
                </div>

            <#--分页-->
                <div class="col-md-8 column">
                    <ul class="pagination pull-right">
                    <#if currentPage lt 1>
                        <li class="disabled"><a href="#">上一页</a></li>
                    <#else>
                        <li>
                            <a href="/sell/stat/admin/list?page=${currentPage}&size=${size}&openid=${openid}&dateStart=${dateStart}&dateEnd=${dateEnd}">上一页</a>
                        </li>
                    </#if>
                    <#if pageList.getTotalPages()<1>
                        <#list 1.. as index>
                            <#if currentPage+1 == index>
                            <li class="disabled"><a href="#">${index}</a></li>
                            <#else>
                            <li>
                                <a href="/sell/stat/admin/list?page=${index}&size=${size}&openid=${openid}&dateStart=${dateStart}&dateEnd=${dateEnd}">${index}</a>
                            </li>
                            </#if>
                        </#list>
                    <#else>
                        <#list 1..pageList.getTotalPages() as index>
                            <#if currentPage+1 == index>
                            <li class="disabled"><a href="#">${index}</a></li>
                            <#else>
                            <li>
                                <a href="/sell/stat/admin/list?page=${index}&size=${size}&openid=${openid}&dateStart=${dateStart}&dateEnd=${dateEnd}">${index}</a>
                            </li>
                            </#if>
                        </#list>
                    </#if>
                    <#if currentPage+1 gte pageList.getTotalPages()>
                        <li class="disabled"><a href="#">下一页</a></li>
                    <#else>
                        <li>
                            <a href="/sell/stat/admin/list?page=${currentPage + 2}&size=${size}&openid=${openid}&dateStart=${dateStart}&dateEnd=${dateEnd}">下一页</a>
                        </li>
                    </#if>
                    </ul>
                </div>
            </div>
        </div>
    </div st>
</div>
<script type="text/javascript" src="/sell/static/js/jsapi.js"></script>
<script type="text/javascript" src="/sell/static/js/corechart.js"></script>
<script type="text/javascript" src="/sell/static/js/jquery.gvChart-1.0.1.min.js"></script>
<script>
    gvChartInit();
    $(document).ready(function () {
        /*ID 折线图*/
        $('#oldday').gvChart({
            chartType: 'LineChart',
            gvSettings: {
                vAxis: {title: '数据数量/个'},
                hAxis: {title: '日期'},
                width: 1100,
                height: 350
            }
        });
    });

    $('.form_datetime').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 1,
        minView: 2,
        viewSelect: 'month',
        format: 'yyyy-mm-dd'
    });

    function p(s) {
        return s < 10 ? '0' + s : s;
    }

    var myDate = new Date();
    //获取当前年
    var year = myDate.getFullYear();
    //获取当前月
    var month = myDate.getMonth() + 1;
    //获取当前日
    var date = myDate.getDate();
    var now = year + '-' + p(month) + "-" + p(date);
    $('#mdate').val(now);

</script>
</body>

</html>
